local Class = require('lua.lang.Class')
local LuaValue = require('lua.vm.LuaValue')

--- @class LuaFunction : LuaValue
--- @field metatable LuaValue
local LuaFunction = Class {
	__extends = LuaValue
}

--- @return number
function LuaFunction:type()
	return self.TYPE_FUNCTION
end

--- @return string
function LuaFunction:typeName()
	return self.TYPE_NAMES[self:type() + 1]
end

--- @return LuaFunction
function LuaFunction:checkFunction()
	return self
end

--- @return LuaValue
function LuaFunction:getmetatable()
	return self.metatable
end

--- @return string
function LuaFunction:toLString()
	return 'function: ' .. self.cid
end

--- @return boolean
function LuaFunction:isFunction()
	return true
end

return LuaFunction